import requests
import json


def send_message_to_wechat(webhook_url, content):
    headers = {
        'Content-Type': 'application/json',
    }
    data = {
        "msgtype": "text",
        "text": {
            "content": content
        }
    }
    response = requests.post(webhook_url, headers=headers, data=json.dumps(data))
    return response.json()


# 使用示例
if __name__ == "__main__":
    webhook_url = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=34d234fc-bf46-4436-93e1-d823994c2443"
    content = "Hello, WeChat!"  # 你要发送的消息内容
    response = send_message_to_wechat(webhook_url, content)
    print(response)